# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=rdpassspray
pkgver=33.c1ba58e
pkgrel=5
pkgdesc='Python3 tool to perform password spraying using RDP.'
arch=('any')
groups=('blackarch' 'blackarch-cracker')
url='https://github.com/xFreed0m/RDPassSpray'
license=('GPL3')
depends=('python' 'python-argparse' 'python-colorlog' 'freerdp')
makedepends=('git')
source=("$pkgname::git+https://github.com/xFreed0m/RDPassSpray.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i '1i #!/usr/bin/python' *.py
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 755 -t "$pkgdir/usr/share/$pkgname/" *.py

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md *.png
  install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE

  ln -s "/usr/share/$pkgname/RDPassSpray.py" "$pkgdir/usr/bin/$pkgname"
}

